#ifndef __logic_manager__h__
#define __logic_manager__h__

#include "singleton.h"
#include "logic_state.h"

#include <map>
using namespace std;

//state id
typedef int STATE_ID;
enum
{
    STATE_MAIN_MENU = 0,
	STATE_SCENE_SELECT = 1,
	STATE_GAME_DOING = 2
};

//this is a fsm
class logic_manager : public singleton<logic_manager>
{
public:
    logic_manager();
	~logic_manager();

	static bool logic_update();
    logic_state* get_current_state();
	void change_state_to(STATE_ID id);
	void register_state(STATE_ID id, logic_state* state, bool set_current = false);
    logic_state* get_state_by_id(STATE_ID id);

private:
	logic_state* current_state;
	map<STATE_ID, logic_state*> logic_states;
};
#endif